const expressJwt = require("express-jwt");
const { secretKey } = require('./salt');
const jwtAuth = expressJwt({
secret: secretKey,
credentialsRequired: true // false：不校验
}).unless({
path: ["/users/login", "/users/reg","/users/isUse","/admins/login","/admins/reg","/admins/isUse","/favicon.ico"]
 //排除请求的路径，除path有的路径访问，都需要携带token
});
module.exports = jwtAuth;